package cn.com.eado.crm.model.db

import androidx.lifecycle.LiveData
import androidx.room.*
import cn.com.eado.crm.m.db.CusUser


@Dao
interface CusUserDao {
    @Insert//(onConflict = OnConflictStrategy.REPLACE)
    fun insert(cusUser: CusUser)

//    @Insert//(onConflict = OnConflictStrategy.REPLACE)
//    fun insert(companys: List<CusUser>)

//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    fun replaceAll(enterpriseInfos: List<CusUser>)

//    @Insert(onConflict = OnConflictStrategy.REPLACE)
//    fun replace(cusUser: CusUser)

    @Delete
    fun delete(cusUser: CusUser)

//    @Delete
//    fun delete(companys: List<CusUser>)

    @Update
    fun update(cusUser: CusUser)

//    @Update
//    fun update(companys: List<CusUser>)

//    @Query("select * from enterprise_info")  //查询所有
//    fun queryAll(): LiveData<List<CusUser>>

//    @Query("select * from cus_user")  //查询所有
//    fun queryWithUser(userId: Int): LiveData<CusUser>?  //即使没有数据返回的也不少null，而是[]

//    @Query("select * from cusUser where userId = :userId")  //查询所有
//    fun queryWithUser2(userId: Int): List<CusUser>?  //即使没有数据返回的也不少null，而是[]

}